package edu.scu.declaresys.vo;

import edu.scu.declaresys.dao.util.Column;
import edu.scu.declaresys.dao.util.FieldWalker;
import edu.scu.declaresys.dao.util.Table;

/**
 * 
 * @author: zt
 * @since : 2013-7-3
 */
@Table(code=MsgClass.T_TABLE)
public class MsgClass implements java.io.Serializable
{
	private static final long	serialVersionUID	= -3575560099362350899L;
	//
	// table column name
	//
	public static final String T_TABLE            = "msg_class";
	public static final String T_ID               = "id";
	public static final String T_NAME             = "name";
	//
	// Fields
	//
	@Column(code=T_ID)
	private Integer	id;
	@Column(code=T_NAME)
	private String	name;
	//
	// Constructors
	//
	/** default constructor */
	public MsgClass()
	{
	}
	
	/** full constructor */
	public MsgClass(String name)
	{
		this.name = name;
	}
	//
	// Override functions.
	//
	public String toString()
	{
		return FieldWalker.makeNonstaticFields(this, FieldWalker.WITHOUT_NULL);
	}
	
	@Override
	public int hashCode()
	{
		return id.hashCode();
	}

	@Override
	public boolean equals(Object obj)
	{
		if(this == obj)
		{
			return true;
		}
		if(obj == null)
		{
			return false;
		}
		if(!(obj instanceof MsgClass))
		{
			return false;
		}
		//
		return this.id.equals(((MsgClass)obj).id);
	}
	//
	// Getters and Setters.
	//
	public Integer getId()
	{
		return this.id;
	}
	
	public void setId(Integer id)
	{
		this.id = id;
	}
	
	public String getName()
	{
		return this.name;
	}
	
	public void setName(String name)
	{
		this.name = name;
	}
	
}
